//
//  WarnLevelConfig.m
//  Rail
//
//  Created by hychen on 2018/3/1.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "WarnLevelConfig.h"

@implementation WarnLevelInfoModel

@end

@implementation WarnLevelConfig

//+ (NSString *)warnTypeString:(WarnType)warnType {
//    NSString *string = @"";
//    switch (warnType) {
//        case WarnTypeSOS:
//            string = @"SOS报警";
//            break;
//        case WarnTypeCutdown:
//            string = @"剪断报警";
//            break;
//        case WarnTypeDisappear:
//            string = @"消失报警";
//            break;
//        case WarnTypeUserWatch:
//            string = @"人员巡检报警";
//            break;
//        case WarnTypeLowBattery:
//            string = @"低电量报警";
//            break;
//        case WarnTypeCutdownDone:
//            string = @"剪断报警消除";
//            break;
//        case WarnTypeElectronFence:
//            string = @"电子围栏报警";
//            break;
//        case WarnTypeElectronFenceDone:
//            string = @"电子围栏报警消除";
//            break;
//        default:
//            break;
//    }
//    return string;
//}

+ (WarnLevelInfoModel *)warnLevelInfoWithType:(WarnLevelType)type {
    WarnLevelInfoModel *model = [WarnLevelInfoModel new];
    switch (type) {
        case WarnLevelTypeNormal:
        {
            model.title = @"普通";
            model.color = Color_RGB(255, 200, 7);
            model.image = ImageNamed_bb(@"information_general_warn_ic");
            return model;
        }
            break;
        case WarnLevelTypeWarn:
        {
            model.title = @"警告";
            model.color = Color_RGB(255, 159, 7);
            model.image = ImageNamed_bb(@"information_common_warn_ic");
            return model;
        }
            break;
        case WarnLevelTypeSerious:
        {
            model.title = @"严重";
            model.color = Color_RGB(255, 122, 0);
            model.image = ImageNamed_bb(@"information_severity_warn_ic");
            return model;
        }
            break;
        case WarnLevelTypeHeavy:
        {
            model.title = @"重大";
            model.color = Color_RGB(255, 30, 0);
            model.image = ImageNamed_bb(@"information_great_warn_ic");
            return model;
        }
            break;
        default:
            return nil;
            break;
    }
}

+ (NSString *)lineWorkStatusString:(LineWorkingStatus)status {
    NSString *title = @"";
    switch (status) {
        case LineWorkingStatusTodo:
            title = @"未开工";
            break;
        case LineWorkingStatusWorking:
            title = @"施工中";
            break;
        case LineWorkingStatusFinish:
            title = @"已完工";
            break;
        default:
            title = @"未开工";
            break;
    }
    return title;
}


+ (NSString *)deviceStatusString:(DeviceStatus)status {
    NSString *title = @"";
    switch (status) {
        case DeviceStatusOnline:
            title = @"在线";
            break;
        case DeviceStatusOffline:
            title = @"离线";
        default:
            break;
    }
    return title;
}

+ (NSString *)workAreaStatusString:(WorkAreaStatus)status {
    NSString *title = @"";
    switch (status) {
        case WorkAreaStatusTodoWork:
            title = @"未开工";
            break;
        case WorkAreaStatusWorking:
            title = @"施工中";
            break;
        case WorkAreaStatusFinish:
            title = @"已完工";
            break;
        default:
            title = @"未开工";
            break;
    }
    return title;
}

+ (NSString *)carTypeStringWithType:(CarType)type {
    NSString *typeString = @"";
    switch (type) {
        case CarTypeCoach:
            typeString = @"客车";
            break;
        case CarTypeSedan:
            typeString = @"轿车";
            break;
        case CarTypeTruch:
            typeString = @"卡车";
            break;
        case CarTypeTractor:
            typeString = @"牵引车";
            break;
        case CarTypeTransport:
            typeString = @"专用运输车";
            break;
        case CarTypeSpecialCar:
            typeString = @"特种车";
            break;
        default:
            typeString = @"";
            break;
    }
    return typeString;
}

//+ (NSString *)alertTypeStringWithType:(WarnType)type {
//    switch (type) {
//        case WarnTypeUserWatch:
//            return @"人员巡检报警";
//            break;
//        case WarnTypeElectronFence:
//            return @"电子围栏报警";
//            break;
//        case WarnTypeSOS:
//            return @"SOS报警";
//            break;
//        case WarnTypeCutdown:
//            return @"剪断报警";
//            break;
//        case WarnTypeDisappear:
//            return @"消失报警";
//            break;
//        case WarnTypeElectronFenceDone:
//            return @"电子围栏报警消除";
//            break;
//        case WarnTypeCutdownDone:
//            return @"剪断报警消除";
//            break;
//        case WarnTypeLowBattery:
//            return @"低电量报警";
//            break;
//        default:
//            break;
//    }
//}

+ (NSString *)alertTypeStringWithType:(NSString *)alertType {
    if ([alertType isEqualToString:@"00"]) {
        return @"人员巡检报警";
    }
    else if ([alertType isEqualToString:@"01"]) {
        return @"电子围栏报警";
    }
    else if ([alertType isEqualToString:@"02"]) {
        return @"SOS报警";
    }
    else if ([alertType isEqualToString:@"03"]) {
        return @"剪断报警";
    }
    else if ([alertType isEqualToString:@"04"]) {
        return @"消失报警";
    }
    else if ([alertType isEqualToString:@"05"]) {
        return @"电子围栏报警消除";
    }
    else if ([alertType isEqualToString:@"06"]) {
        return @"剪断报警消除";
    }
    else if ([alertType isEqualToString:@"07"]) {
        return @"低电量报警";
    }
    return @"未知";
}

+ (NSArray *)carTypeStringArray {
    return @[
             @"轿车",
             @"客车",
             @"卡车",
             @"牵引车",
             @"专用运输车",
             @"特种车",
             ];
}

+ (NSString *)oneLevelTitleNameWithType:(DeviceStatisticType)type {
    switch (type) {
        case DeviceStatisticTypeRke:
            return @"RKE";
        case DeviceStatisticTypeTbk:
            return @"VOIP-A";
        case DeviceStatisticTypeBroadcast:
            return @"VOIP-B";
        case DeviceStatisticTypeHeavy:
            return @"HE";
        case DeviceStatisticTypeLocal:
            return @"GPS";
        case DeviceStatisticTypeEnv:
            return @"EV";
        case DeviceStatisticTypeVideo:
            return @"VIDEO";
        default:
            return @"OTHER";
            break;
    }
}
@end
